 <template>
     <div class="container-fluid container-med2" style="width:1200px; ">


    <el-form class="el1">
    <h1>编辑页面</h1>
    <el-form ref="form" :model="form" label-width="80px">
    <el-form-item label="实验目的" >
        <el-input v-model="form.purpose"></el-input>
    </el-form-item>
    <el-form-item label="实验内容">
        <el-input v-model="form.content"></el-input>
    </el-form-item>
    <el-form-item label="实验步骤">

            <el-form-item>
                <el-button type="primary" v-model="form.detail" @click="">新增</el-button>
            </el-form-item>

        <el-upload
            class="upload-demo"
            action="https://jsonplaceholder.typicode.com/posts/"
            :on-preview="handlePreview"
            :on-remove="handleRemove"
            :file-list="fileList">
            <el-button size="small" type="primary">上传附件</el-button>
        </el-upload>
    </el-form-item>
    <el-form-item label="发布时间">
        <el-col :span="5">
        <el-date-picker type="date" placeholder="选择日期" v-model="form.date2" style="width: 100%;"></el-date-picker>
        </el-col>
    </el-form-item>
    <el-form-item label="截止时间">
        <el-col :span="5">
        <el-date-picker type="date" placeholder="选择日期" v-model="form.date2" style="width: 100%;"></el-date-picker>
        </el-col>
    </el-form-item>
    <el-form-item label="备注">
        <el-input type="textarea" v-model="form.desc"></el-input>
    </el-form-item>
    <el-form-item>
        <el-button type="primary" @click="onSubmit">完成编辑</el-button>
        <el-button type="danger" @click="open2">取消</el-button>
    </el-form-item>
    </el-form>

</el-form>

     </div>
</template>  
<script>
  export default {
    data() {
      return {
        
        form: {
            purpose: '',
            content: '',
            detail:'',
            date1: '',
            date2: '',
            desc: ''
        },
        addForm:{
            name: '',
            judge: -1,
        },
        fileList: [
            {name: '',url: ''}]
      };
    },

    methods: {
        open2() {

            this.$confirm('是否取消?', '提示', {
                confirmButtonText: '确定',
                cancelButtonText: '取消',
                type: 'warning'
            }).then(() => {
                this.$message({
                    type: 'success',
                    message: '取消成功!',

                });
                this.$router.go(-1);
            }).catch(() => {
                this.$message({
                    type: 'info',

                });
            });

        },
      handleRemove(file, fileList) {
        console.log(file, fileList);
      },
      handlePreview(file) {
        console.log(file);
      },
      onSubmit() {
        console.log('submit!');
      },

/*        handleAdd: function () {
            dialogTableVisible: false,
            this.addForm = {
                name: '',
                judge: -1,
            };
        },*/
/*        addSubmit: function () {
            this.$refs.addForm.validate((valid) => {
                if (valid) {
                    this.$confirm('确认提交吗？', '提示', {}).then(() => {
                        this.addLoading = true;
                        //NProgress.start();
                        let para = Object.assign({}, this.addForm);
                        addUser(para).then((res) => {
                            this.addLoading = false;
                            //NProgress.done();
                            this.$message({
                                message: '提交成功',
                                type: 'success'
                            });
                            this.$refs['addForm'].resetFields();
                            this.addFormVisible = false;
                            this.getUsers();
                        });
                    });
                }
            });
        },*/
    },

  }
</script>

<style scoped>

 .container-med2{
    margin-top: 160px;
    margin: 0 auto ;
    -webkit-box-shadow:1px 1px 15px rgba(144, 144, 144, 1);
    box-shadow:1px 1px 15px rgba(144, 144, 144, 1);
  }
  .el1{
    padding-top: 10px;
    padding-right: 30px;
    padding-left: 30px;
    padding-bottom: 50px;
  }
</style>